package at.guigu.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@Slf4j
@Configuration
public class RemoteCallConfig {
    // 负载均衡注解实现服务消费者对Eureka服务拉取/订阅/发现
    @LoadBalanced
    @Bean
    public RestTemplate restTemplate() {
        log.info("restTemplate创建成功，微服务远程调用开启");
        return new RestTemplate();
    }
}
